/*
 * Copyright (c) 2023 huipei.x
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.xphsc.kubernetes.core.query;

import io.kubernetes.client.openapi.models.V1DeleteOptions;
/**
 * {@link }
 * @author <a href="xiongpeih@163.com">huipei.x</a>
 * @description: Delete Options Body
 * @since 1.0.0
 */
public class DeleteOptionsBody {
    /**
     * the Namespace (required)
     */
    private String namespace;
    /**
     * name
     */
    private  String name;
    /**
     * pretty If &#39;true&#39;, then the output is pretty printed. (optional)
     */
    private String pretty;
    /**
     * dryRun When present, indicates that modifications should not be persisted. An invalid or
     *  unrecognized dryRun directive will result in an error response and no further processing of
     *  the request. Valid values are: - All: all dry run stages will be processed (optional)
     */
    private  String dryRun;
    /**
     * the duration in seconds before the object should be deleted. Value
     * must be non-negative integer. The value zero indicates delete immediately. If this value is
     *  nil, the default grace period for the specified type will be used. Defaults to a per object
     *  value if not specified. zero means delete immediately. (optional)
     */
    private Integer gracePeriodSeconds;
    /**
     * Deprecated: please use the PropagationPolicy, this field will be
     *  deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the
     *  \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers
     *  list. Either this field or PropagationPolicy may be set, but not both. (optional)
     */
    private Boolean orphanDependents;
    /**
     * Whether and how garbage collection will be performed. Either this
     *  field or OrphanDependents may be set, but not both. The default policy is decided by the
     *   existing finalizer set in the metadata.finalizers and the resource-specific default policy.
     *  Acceptable values are: &#39;Orphan&#39; - orphan the dependents; &#39;Background&#39; -
     *  allow the garbage collector to delete the dependents in the background;
     *  &#39;Foreground&#39; - a cascading policy that deletes all dependents in the foreground.
     *  (optional)
     */
    private  String propagationPolicy;
    /**
     * body (optional)
     */
    private V1DeleteOptions body;

    public static DeleteOptionsBody.Builder builder() {
        return new DeleteOptionsBody.Builder();
    }

    private DeleteOptionsBody(DeleteOptionsBody.Builder builder) {
        this.namespace = builder.namespace;
        this.name = builder.name;
        this.pretty = builder.pretty;
        this.dryRun = builder.dryRun;
        this.gracePeriodSeconds = builder.gracePeriodSeconds;
        this.orphanDependents=builder.orphanDependents;
        this.propagationPolicy=builder.propagationPolicy;
        this.body=builder.body;
    }


    public static class Builder {
        private String namespace;
        private  String name;
        private   String pretty;
        private String dryRun;
        private Integer gracePeriodSeconds;
        private Boolean orphanDependents;
        private String propagationPolicy;
        private V1DeleteOptions body;
        public Builder() {
        }
        /**
         * name name of the Namespace (required)
         */
        public <T> DeleteOptionsBody.Builder namespace(String namespace) {
            this.namespace = namespace;
            return this;
        }

        /**
         * name
         */
        public <T> DeleteOptionsBody.Builder name(String name) {
            this.name = name;
            return this;
        }
        /**
         * pretty If &#39;true&#39;, then the output is pretty printed. (optional)
         */
        public <T> DeleteOptionsBody.Builder pretty(String pretty) {
            this.pretty = pretty;
            return this;
        }

        /**
         * dryRun When present, indicates that modifications should not be persisted. An invalid or
         *  unrecognized dryRun directive will result in an error response and no further processing of
         *  the request. Valid values are: - All: all dry run stages will be processed (optional)
         */
        public <T> DeleteOptionsBody.Builder dryRun(String dryRun) {
            this.dryRun = dryRun;
            return this;
        }
        /**
         * the duration in seconds before the object should be deleted. Value
         * must be non-negative integer. The value zero indicates delete immediately. If this value is
         *  nil, the default grace period for the specified type will be used. Defaults to a per object
         *  value if not specified. zero means delete immediately. (optional)
         */
        public <T> DeleteOptionsBody.Builder gracePeriodSeconds(Integer gracePeriodSeconds) {
            this.gracePeriodSeconds = gracePeriodSeconds;
            return this;
        }
        /**
         * Deprecated: please use the PropagationPolicy, this field will be
         *  deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the
         *  \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers
         *  list. Either this field or PropagationPolicy may be set, but not both. (optional)
         */
        public <T> DeleteOptionsBody.Builder orphanDependents(Boolean orphanDependents) {
            this.orphanDependents = orphanDependents;
            return this;
        }
        /**
         * Whether and how garbage collection will be performed. Either this
         *  field or OrphanDependents may be set, but not both. The default policy is decided by the
         *   existing finalizer set in the metadata.finalizers and the resource-specific default policy.
         *  Acceptable values are: &#39;Orphan&#39; - orphan the dependents; &#39;Background&#39; -
         *  allow the garbage collector to delete the dependents in the background;
         *  &#39;Foreground&#39; - a cascading policy that deletes all dependents in the foreground.
         *  (optional)
         */
        public <T> DeleteOptionsBody.Builder propagationPolicy(String propagationPolicy) {
            this.propagationPolicy = propagationPolicy;
            return this;
        }
        /**
         * body (optional)
         */
        public <T> DeleteOptionsBody.Builder body(V1DeleteOptions body) {
            this.body = body;
            return this;
        }
        public DeleteOptionsBody build() {
            return new DeleteOptionsBody(this);
        }
    }





    public String namespace() {
        return namespace;
    }

    public String name() {
        return name;
    }

    public String pretty() {
        return pretty;
    }

    public String dryRun() {
        return dryRun;
    }

    public Integer gracePeriodSeconds() {
        return gracePeriodSeconds;
    }

    public Boolean orphanDependents() {
        return orphanDependents;
    }

    public String propagationPolicy() {
        return propagationPolicy;
    }

    public V1DeleteOptions body() {
        return body;
    }
}
